<?php

namespace Database\Factories;

use App\Models\User;
use Illuminate\Support\Str;
use Illuminate\Database\Eloquent\Factories\Factory;

class OpenAPIFactory extends Factory
{
    /**
     * Define the model's default state.
     *
     * @return array
     */
    public function definition()
    {
        return [
            'api_token' => 'GuanGai-' . Str::random(56),
            'user_id' => $this->faker->randomElement(User::all()->pluck('id')),
            'valid' => '0',
        ];
    }
}
